import { createRouter, createWebHistory } from 'vue-router'
const routes = [

    {
        path: '/entryedit',
        name: 'entryedit',
        component: () => import('../views/EntryEdit/EntryEdit.vue')
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/Login/Login.vue')
    },
    {
        path: '/admin_login',
        name: 'admin_login',
        component: () => import('../views/AdminLogin/AdminLogin.vue')
    },
    {
        path: '/admin',
        name: 'admin',
        component: () => import('../views/AdminPage/AdminPage.vue')
    },
    {
        path: '/codeedit',
        name: 'codeedit',
        component: () => import('../views/CodeEditor/CodeEditor.vue')
    },
    {
        path: '/programview',
        name: 'programview',
        component: () => import('../views/ProgramView/ProgramView.vue')
    },
    {
        path: '/main',
        name: 'main',
        redirect: '/main/search',
        component: () => import('../views/Main/Main.vue'),
        children: [
            {
                path: 'show',
                name: 'show',
                component: () => import('../components/Main/Content')
            },
            {
                path: 'search',
                name: 'search',
                component: () => import('../components/Main/Search')
            }
        ]
    },
    {
        path: '/',
        redirect: '/main/search'
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
